<template>
  <div class="hello">
    <mt-swipe :auto="4000" :style="{ height: `${swiperHieght}px` }" class="item">
        <mt-swipe-item><img @load="old" ref="img"  src="../../static/images/pic1.webp.jpg"></mt-swipe-item>
        <mt-swipe-item><img  src="../../static/images/pic2.webp.jpg"></mt-swipe-item>
        <mt-swipe-item><img  src="../../static/images/pic3.webp.jpg"></mt-swipe-item>
    </mt-swipe>

  </div>
</template>

<script>
import { Swipe, SwipeItem } from 'mint-ui'
export default {
  name: 'list',
  data () {
    return {
      swiperHieght: 0
    }
  },
  props: {

  },

  methods: {
    old () {
      this.swiperHieght = this.$refs.img.offsetHeight
    }

  },
  mounted () {
    this.$parent.$on('getmsg', msg => {
      console.log(msg)
    })
  },

  components: { Swipe, SwipeItem }
}
</script>

<style scoped>
h1,
h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}

.item img{
    width: 100%;
}
</style>
